// 1983 Recoding

global keepers1983 ""

numlabel, add

genl id=id1
global keepers1983 $keepers1983 id

genl year=1983
global keepers1983 $keepers1983 year

genl wt=weight
global keepers1983 $keepers1983 wt

genl pid_ce=q13a
recode pid_ce 2/99=0
global keepers1983 $keepers1983 pid_ce

genl vote_ce=q9a
recode vote_ce 0=. 2/97=0
global keepers1983 $keepers1983 vote_ce

genl turnout=q7a
recode turnout 2=0
global keepers1983 $keepers1983 turnout


// Campaign Interest

codebook q2d
gen polsmeetingnew = q2d
recode polsmeetingnew 1=1 2=0
label variable polsmeetingnew "Attended political meeting new"
label define attend 1 "1=attended meeting"
label values polsmeetingnew attend
tab polsmeetingnew q2d
global keepers1983 $keepers1983 polsmeetingnew

codebook q1
gen intissuenew = q1
recode intissuenew 1=1 2=0 9=.
label variable intissuenew "cared about who won new"
label define care 1 "1=cared"
label values intissuenew care
tab q1 intissuenew
global keepers1983 $keepers1983 intissuenew


// Media Exposure

codebook q2b
gen npfollownew = q2b
recode npfollownew 1=1 2=0 9=.
label variable npfollownew "followed campaign in newspaper new"
label define follows 1 "1=followed"
label values npfollownew follows
tab q2b npfollownew
global keepers1983 $keepers1983 npfollownew

// Ideology

codebook q31a
gen taxspendnew = q31a
recode taxspendnew 98=0 95=. 96=. 99=.
gen taxspendnewx = taxspendnew + 10
replace taxspendnewx = (abs(taxspendnewx-20))/20
replace taxspendnew = taxspendnewx
drop taxspendnewx
label variable taxspendnew "social spending new"
label define spend 1 "1=pro-spending" 
label values taxspendnew spend
tab taxspendnew
tab q31a
global keepers1983 $keepers1983 taxspendnew

gen leftrightselfnew = q46g
recode leftrightselfnew 98=0 95=. 96=. 97=10 99=.
gen lr10 = leftrightselfnew +10
replace lr10 = (abs(lr10-20))/20
replace leftrightselfnew = lr10
drop lr10
tab leftrightselfnew
tab q46g
label variable leftrightselfnew "left-right self placement new"
label define lr 1 "1=left"
label values leftrightselfnew lr
tab leftrightselfnew
global keepers1983 $keepers1983 leftrightselfnew

codebook q40c
gen industrytaxnew = q40c
recode industrytaxnew 8=2 9=.
gen flipit = 4-industrytaxnew
replace flipit=(abs(flipit-3))/2
tab flipit q40c
replace industrytaxnew = flipit
drop flipit
label variable industrytaxnew "increase industry taxes new"
label define tax 1 "1=increase tax"
label values industrytaxnew tax
tab industrytaxnew q40c
global keepers1983 $keepers1983 industrytaxnew

codebook q30b
gen wagecntrlnew = q30b
recode wagecntrlnew 1=1 2=.5 3=0 9=.
label variable wagecntrlnew "wage controls new"
label define increase 1 "1=increase"
label values wagecntrlnew increase
tab q30b wagecntrlnew
global keepers1983 $keepers1983 wagecntrlnew

codebook q40a
gen unionregnew = q40a
recode unionregnew 1=1 2=.5 3=0 8=.5 9=.
label variable unionregnew "gov't regulation of unions new"
label define reg 1 "1=increase regulation"
label values unionregnew reg
tab q40a unionregnew
global keepers1983 $keepers1983 unionregnew

codebook q36a
gen stateownnew = q36a
recode stateownnew 95=. 96=. 97=10 98=0 99=.
gen stateownx = stateown + 10
tab stateownx
replace stateownx = (abs(stateownx-20))/20
replace stateownnew = stateownx
drop stateownx
label variable stateownnew "nationalisation new"
label define natnlown 1 "1=pro-nationalisation"
label values stateownnew natnlown
tab stateownnew
tab q36a
global keepers1983 $keepers1983 stateownnew

codebook q37
gen stateownnew1983 = q37
recode stateownnew1983 8=2.5 9=.
replace stateownnew1983=(abs(stateownnew1983-4))/3
label variable stateownnew1983 "nationalisation 1983 new"
label values stateownnew1983 natnlown
tab stateownnew1983 q37
global keepers1983 $keepers1983 stateownnew1983

codebook q35b
gen povertyspendnew = q35b
recode povertyspendnew 1=1 2=.5 3=0 8=.5 9=.
label variable povertyspendnew "gov't spending on poverty reduction"
label values povertyspendnew spend
tab q35b povertyspendnew
global keepers1983 $keepers1983 povertyspendnew

codebook q45a
gen welfarespendnew = q45a
recode welfarespendnew 1=0 2=.5 3=1 8=.5 9=.
label variable welfarespendnew "welfare spending new"
label values welfarespendnew spend
tab q45a welfarespendnew
global keepers1983 $keepers1983 welfarespendnew

gen buspowernew = q38b
recode buspowernew 1=1 2=0 8=.5 9=.
label variable buspowernew "business power new"
label define powers 1 "1=too much power"
label values buspowernew powers
tab buspowernew q38b
global keepers1983 $keepers1983 buspowernew

gen unionpowernew = q38a
recode unionpowernew 1=1 2=0 8=.5 9=.
label variable unionpowernew "union power new"
label values unionpowernew powers
tab unionpowernew q38a
global keepers1983 $keepers1983 unionpowernew


// Class/occupation

// Assuming that husband is "head of household"
*gen class_head_grade = 
*recode class_head_grade 0=.
label define LblClassGoldHeath 1 "High grade prof./man." 2 "Low grade prof./man." 3 "Routine office" 4 "Sales & personal" 5 "Small petty bourg. w emps" 6 "Small petty bourg. wo emps" 7 "Farmers" 8 "Manual foremen" 9 "Skilled manual" 10 "Semi & unskilled manual" 11 "Agric. employees"
*label values class_head_grade LblClassGrade
*global keepers1983 $keepers1983 class_head_grade

gen class_resp_goldheath = rghclass
recode class_resp_goldheath 0=.
label values class_resp_goldheath LblClassGoldHeath
global keepers1983 $keepers1983 class_resp_goldheath

gen class_spou_goldheath = sghclass
recode class_spou_goldheath 0=.
label values class_spou_goldheath LblClassGoldHeath
global keepers1983 $keepers1983 class_spou_goldheath

gen male = q64b
recode male 1=1 2=0
global keepers1983 $keepers1983 male

gen married = q54a
recode married 1=1 2=0 3=0 4=1 9=0
global keepers1983 $keepers1983 married

gen unionmem_resp = q52c
recode unionmem_resp 0=. 1=1 2=0 3=0 9=.
global keepers1983 $keepers1983 unionmem_resp

gen unionmem_spou = q54d
recode unionmem_spou 0=. 1=1 2=0 3=0 4=. 9=.
global keepers1983 $keepers1983 unionmem_spou

gen unionmempast_resp = q52c
recode unionmempast_resp 0=. 1=0 2=1 3=0 9=.
global keepers1983 $keepers1983 unionmempast_resp

gen unionmempast_spou = q54d
recode unionmempast_spou 0=. 1=1 2=1 3=0 4=. 9=.
global keepers1983 $keepers1983 unionmempast_spou



// Economic perceptions

gen econ_ego_retro = q50b
recode econ_ego_retro 8/9=. 1=0 2=1 3=2
global keepers1983 $keepers1983 econ_ego_retro
